<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>SB Admin</title>
    <!-- Bootstrap core CSS-->
    <link href="/fashionpress/admin/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom fonts for this template-->
    <link href="/fashionpress/admin/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!-- Custom styles for this template-->
    <link href="/fashionpress/admin/css/sb-admin.css" rel="stylesheet">
</head>

<body class="bg-dark">
<div class="container">
    <div class="card card-login mx-auto mt-5">
        <div class="card-header">Reset Password</div>
        <div class="card-body">
            <div class="text-center mt-4 mb-5">
                <h4>Forgot your password?</h4>
                <p>Enter your reginster phone and we will help you to reset your password.</p>
            </div>
            <form action="/fashionpress/admin/checkadminphone" method="post">
                <div class="form-group">
                    <input class="form-control" id="adminName" type="text" name="adminName" size="20"  placeholder="Enter you reginster name" th:value="${formAdmin!=null?formAdmin.adminUsername:''}">
                </div>
                <div class="form-group" >
                    <span style="color: red; " id="checkadminname"></span>
                </div>
                <div class="form-group">
                    <input class="form-control" id="adminPhone" type="tel" name="adminPhone"  placeholder="Enter you reginster phone" th:value="${formAdmin!=null?formAdmin.adminPhone:''}">
                </div>
                <div class="form-group" >
                    <span style="color: red; " id="checkPhone"></span>
                </div>
                <div class="form-group">
                    <input type="submit" value="commit" class="form-control">
                </div>
            </form>
            <div class="text-center">
                <a class="d-block small" href="/fashionpress/admin/">Login Page</a>
            </div>
        </div>
    </div>
</div>
<!-- Bootstrap core JavaScript-->
<script src="/fashionpress/admin/vendor/jquery/jquery.min.js"></script>
<script src="/fashionpress/admin/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Core plugin JavaScript-->
<script src="/fashionpress/admin/vendor/jquery-easing/jquery.easing.min.js"></script>
<script>
    $(document).ready(function () {
        $("#adminName").blur(function () {
            $name = $("#adminName").val();
            $.ajax({url:"/fashionpress/admin/checkusername/"+$name,
                cache:true,
                async:true,
                dataType:"text",
                success: function (data,textStatus,jqXHR) {

                    console.log(data);

                    document.getElementById("checkadminname").innerText=data;

                }

            });

        })
    });
</script>
<script>
    if("[[${msg}]]"!=""){
        document.getElementById("checkPhone").innerText="[[${msg}]]";
    }
</script>
</body>

</html>